home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / BASIC / 3940.ZIP / PWEZ.ZIP / TIPS.DOC < prev    next >
Text File  |  1993-06-01  |  8KB  |  181 lines

  1.  
  2.  
  3.  
  4.                              TIPS AND SUGGESTIONS
  5.  
  6.          NOTE: Argument designations are those used in the
  7.          documentation - WIND_REZ.DOC.
  8.  
  9.  
  10.          1. Pulldown and scroll windows require a dummy array to hold
  11.             the info-line data when the info-line is not used.  All
  12.             modules and calls to SCRLWIND and PULLDOWN may use the
  13.             same dummy array.
  14.  
  15.             Place this in the main module:
  16.  
  17.             COMMON SHARED /DUMMYDATA/ DUMMY$()
  18.             DIM DUMMY$(0)
  19.  
  20.             Place this in any other module using routines PULLDOWN or
  21.             SCRLWIND not using the info-line.
  22.  
  23.             COMMON SHARED /DUMMYDATA/ DUMMY$()
  24.  
  25.             Use DUMMY$() to represent the info-line ( when it is not
  26.             used ) in calls to SCRLWIND and PULLDOWN.
  27.  
  28.  
  29.          2. QuickBASIC 4.5 can be very unpredictable when using ON
  30.             ERROR GO TO ..  in a sub program or function unless the
  31.             sub program or routine is STATIC.
  32.  
  33.             The following is OK.
  34.  
  35.             SUB TEST ( A%, B% ) STATIC
  36.  
  37.               ON ERROR GOTO LABEL     ' LABEL MUST BE AT MODULE LEVEL
  38.  
  39.             END SUB
  40.  
  41.             The following can cause a STRING SPACE CORRUPT error, a
  42.             crash, or the program may bind.  It may work fine in the
  43.             QB environment, but may cause problems in the executable
  44.             program.
  45.  
  46.             SUB TEST ( A%, B% )       ' No STATIC
  47.  
  48.               ON ERROR GOTO LABEL     ' LABEL MUST BE AT MODULE LEVEL
  49.  
  50.             END SUB
  51.  
  52.             If the ON ERROR and LABEL are both in the main module the
  53.             problem does not occur.
  54.  
  55.  
  56.          3. It is important to know if an active PULLDOWN or INPUT
  57.             window exits.  If either unknowingly exists the following
  58.             will occur on entry to the routines.
  59.  
  60.             - Routine INPTWIND will place a field without a window in
  61.               the location it would occupy based on the coordinates of
  62.               the active input window.  The coordinates in the call to
  63.               INPTWIND are ignored.
  64.  
  65.             - Routine PULLDOWN is re-entered in the active pulldown
  66.               window at same location it was at when it was exited. If
  67.               the active input window is not intact it is not re-
  68.               displayed.  The entries in the active pulldown window
  69.               are re-printed without the window.
  70.  
  71.  
  72.          4. Routine MULTINPT is ALWAYS exited when the cursor leaves a
  73.             "FIXED CHOICE" field.  Use argument RKEY% to determine if
  74.             the SPACE BAR or MOUSE exited MULTINPT.  Remember, even if 
  75.             the SPACE BAR or MOUSE is not pressed a FIXED CHOICE field 
  76.             will be exited any time the cursor leaves it, or an exit 
  77.             key is pressed.
  78.  
  79.             If field 5 ( FROMFLD% = 5 on exit ) is a FIXED CHOICE
  80.             field, on exit from routine MULTINPT the following will
  81.             determine why field 5 caused the exit.
  82.  
  83.             'RKEY% represents the exit key.
  84.  
  85.             IF FROMFLD% = 5 THEN        ' Exit was from field 5.
  86.  
  87.                 SELECT CASE RKEY%  
  88.  
  89.                    CASE 32
  90.  
  91.                     ' SPACE BAR caused the exit
  92.  
  93.                    CASE 100 
  94.  
  95.                      IF TOFLD% = 5                  
  96.                        ' LEFT MOUSE BUTTON release with mouse cursor
  97.                        ' in field 5
  98.                      ELSE
  99.                        ' Last active field was field 5 and LEFT MOUSE
  100.                        ' BUTTON released in another field ( TOFLD% )
  101.                      END IF
  102.  
  103.                    CASE 200
  104.                    
  105.                      ' LEFT MOUSE BUTTON pressed with cursor out of
  106.                      ' field 5 and not in any other field.  This can
  107.                      ' only occur if routine SETINPT specified exit
  108.                      ' with LEFT MOUSE BUTTON pressed out of a field.
  109.                     
  110.                    CASE 300
  111.                      
  112.                      ' LEFT MOUSE BUTTON moved active field to another
  113.                      ' field but the LEFT MOUSE BUTTON was released
  114.                      ' with the mouse cursor out of the new active 
  115.                      ' field.  This can not occur if routine SETINPT
  116.                      ' specified exit if LEFT MOUSE BUTTON pressed out
  117.                      ' of a field.
  118.                    
  119.                    CASE ELSE 
  120.  
  121.                      ' Cursor leaving field 5 or an exit key ( F1, F2,
  122.                      ' etc. ) caused the exit.  If exit was not by the
  123.                      ' SPACE BAR or MOUSE the program will ALWAYS proceed 
  124.                      ' here as a FIXED CHOICE field is ALWAYS an auto-exit
  125.                      ' field and MULTINPT is ALWAYS exited.  It may be
  126.                      ' appropriate to do nothing and simply re-enter
  127.                      ' MULTINPT in this case.
  128.  
  129.                 END SELECT
  130.  
  131.             END IF
  132.  
  133.  
  134.          5. If several small windows are placed entirely within a
  135.             larger window it may not be necessary to restore the
  136.             display area under each window.  If the display area under
  137.             the larger window is to be restored it may only be
  138.             necessary to delete the smaller windows via routine
  139.             DELWIND and restore the display area under the larger
  140.             window with routine RSTRWIND.  This is faster and more
  141.             memory efficient than restoring all of the windows.
  142.  
  143.          6.  If partial windows remain on the screen the most likely
  144.              cause is windows were restored out of order.  The top
  145.              window must be restored first if it is not entirely
  146.              inside the bottom window.
  147.  
  148.  
  149.          7.  If a title for a virtual scroll window is defined in the
  150.              call to MAKEWIND for the scroll window, the title will
  151.              not scroll left and right.  The title for virtual scroll
  152.              windows must be set by the argument for the top line in
  153.              routine SCRLWIND. ( TL$ )
  154.  
  155.          8.  The argument for the key character color in virtual
  156.              scroll windows must equal zero or an error 24 will be
  157.              reported.  ( STRING WON'T FIT )
  158.  
  159.          9.  If all fields in a call to MULTINPT are not updated on
  160.              entry the cause is argument FROMFLD% does not equal
  161.              zero.  FROMFLD% sets single field update if not zero.
  162.  
  163.          10. It may appear the input routines are not working if the
  164.              text is the same color as the fields.
  165.  
  166.          11. Functions MUST be declared in all modules using them.
  167.  
  168.          12. If routine B4SCRL is used to set up a call to SCRLWIND
  169.              use it immediately before the call to SCRLWIND.  Do not
  170.              allow anything to change the program flow between the
  171.              calls to B4SCRL and SCRLWIND.  Doing so may result in a
  172.              different scroll window assuming the options specified by
  173.              the call to B4SCRL.
  174.  
  175.          13. If routine B4INPT is used to set up a call to INPTWIND
  176.              use it immediately before the call to INPTWIND.  Do not
  177.              allow anything to change the program flow between the
  178.              calls to B4INPT and INPTWIND.  Doing so may result in a
  179.              different input window assuming the options specified by
  180.              the call to B4INPT.
  181.